﻿using LPLS.Commons.DBModule;
using LPLS.Commons.Enums;
using SqlSugar;
using System;

namespace LPLS.DBEntities.ConfigModels.DataCollectionConfigModule.DataCollectionType.PLC
{

    /// <summary>
    /// PLC变量属性配置  数据采集源为PLC
    /// </summary>
    [DatabaseKey(DatabaseEnum.CollectionConfigDB)]
    [SugarTable(nameof(PLCVarPropertyConfig))]
    public  class PLCVarPropertyConfig
    {

        [SugarColumn(IsPrimaryKey = true)]
        public  Guid  ID { get; set; }

        [SugarColumn(ColumnDescription ="变量名称")]
        /// <summary>
        /// PLC变量名称
        /// </summary>
        public string VarName { get; set; }





        [SugarColumn(ColumnDescription = "变量类型")]
        public DataTypeEnum VarType { get; set; }

        [SugarColumn(IsIgnore =true)]
        public string VarTypeName { get; set; }

        [SugarColumn(ColumnDescription = "变量地址")]
        public string VarAddress { get; set; } 

        [SugarColumn(ColumnDescription = "变量描述",IsNullable =true)]
        public string VarDescription { get; set; }



        //public bool IsRuleVar { get; set; } = false;

        /// <summary>
        /// 设备Id
        /// </summary>
        public Guid  DeviceID { get; set; }
       /// <summary>
       /// 部件ID
       /// </summary>
        public Guid ComponentID { get; set; }

        //[SugarColumn(ColumnDescription = "是否启用")]
        //public bool IsActive { get; set; } = true;



        //[SugarColumn(ColumnDescription = "是否只读")]
        //public bool IsPLCVarReadOnly { get; set; } = true;




    }
}
